package workderservice

import (
	"github.com/uber/jaeger-client-go/crossdock/log"
	"goruntimeDistributionCrawler/engine"
)

type CrawlService struct {}

func (c CrawlService) Process(
	req Request,result *ParseResult) error{
	request,err:=DeserializeRequst(req)
	if err !=nil {
		log.Printf("manager error:",err)
	}
	parseResult,err:=engine.Worker(request)
	if err !=nil {
		log.Printf("worker error:",err)
	}
	resultPre:=SerializeResult(parseResult)
    result.Items=append(result.Items,resultPre.Items...)
    result.Request= append(result.Request,resultPre.Request...)
    return nil
}